<div id="products"><!--start products-->
	<div class="box">
		<div class="box_left">
			<div class="box_right"><a>Đăng tin rao bán bất động sản</a></div>
		</div>
	</div>
	<div id="bg_products" style="width: 97%">
		<div>
			<h4>Nhập thông tin bất động sản cho bán hoặc cho thuê</h4>
            
            <?php echo FlashMessage::getInstance()->display('flashmessage/warning'); ?>
            
			<form method="post">
				<p>
					<label>Tiêu đề</label>
					<input type="text" name="title" value="<?php echo $data['title']; ?>" />
				</p>

				<p>
					<label>Mô tả ngắn</label>
					<textarea class="text-input textarea" name="short_description" cols="79" rows="5"><?php echo $data['short_description']; ?></textarea>
				</p>

				<p>
					<label>
						Hướng
						<select name="direction">
		                    <option>Bất kỳ</option>
		                    <?php foreach(Direction::get_direction() as $key => $direc): ?>
		                        <option <?php if($data['direction'] == $key){echo 'selected';} ?> value="<?php echo $key; ?>"><?php echo $direc; ?></option>
		                    <?php endforeach; ?>
						</select>
						
						Loại giao dịch              
						<select name="transaction_type">
							<option <?php if($data['transaction_type'] == 'rend'){echo 'selected';} ?> value="rent">Cho thuê</option>
							<option <?php if($data['transaction_type'] == 'lease'){echo 'selected';} ?> value="lease">Cần mua</option>
						</select> 
					</label>              
				</p>
				<div class="clear"></div>
				<p>
					<label style="display:initial;float: left" class="w200">
						Tên liên hệ
					</label>
					<input class="text-input w250" type="text" name="contact_name" value="<?php echo $data['contact_name']; ?>" />
				</p>

				<p>
					<label style="display:initial; float: left" class="w200">
						Điện thoại liên hệ
					</label>
					<input class="text-input w200" type="text" name="contact_phone" value="<?php echo $data['contact_phone']; ?>" />
				</p>

				<p>
					<label style="display:initial;float: left" class="w200">
						Giá
					</label>
                    <input class="auto w200" size="25" id="price" type="text" name="price" value="<?php echo $data['price']; ?>"/><em> ₫</em>
				</p>

				<p>
					<label style="display:initial;float: left" class="w200">
						Diện tích
					</label>
					<input class="text-input w200" type="text" name="area" value="<?php echo $data['area']; ?>" /><em> m&sup2;</em>
				</p>

				<p>
					<label style="display:initial;float: left" class="w200">Địa điểm</label>
					<select name="location_id">
						<?php foreach($location as $l):?>
						<option <?php if($data['location_id'] == $l->id){echo 'selected';} ?> value="<?php echo $l->id; ?>"><?php echo $l->name; ?></option>
						<?php endforeach;?>
					</select>
				</p>	

				<p>
					<label style="display:initial;float: left" class="w200">Loại bất động sản</label>
					<select name="land_type">
						<?php foreach(Libs_Land::getInstance()->get_land_type() as $type): ?>
                        <option <?php if($data['land_type'] == $type['id']){echo 'selected';} ?> value="<?php echo $type['id'] ?>"><?php echo $type['name'] ?></option>
                        <?php endforeach; ?>
					</select>
				</p>

				<p>
					<label>Mô tả</label>
					<textarea class="text-input textarea tinymce" style="height: 400px" name="description" cols="79" rows="15"><?php echo $data['description']; ?></textarea>
				</p>

				<p>
					<input class="button" type="submit" value="Đăng tin" />
				</p>
			</form>
		</div>
	</div>
</div>

<script type="text/javascript">
    $(function(){
        $('input.auto').autoNumeric({aSep: '.', aDec: ',', aPad: false, mNum : 12});
    });
</script>